package cn.tommyyang.timetask.service;

import cn.tommyyang.timetask.mapper.QuartzJobMapper;
import cn.tommyyang.timetask.model.QuartzJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

//import com.alibaba.dubbo.config.annotation.Service;


/**
 * Created by 18340 on 2018/9/25.
 */
@Service
@Transactional
public class QuartzJobServiceImpl implements QuartzJobService {
    @Autowired
    QuartzJobMapper mapper;
    @Override
    public List<QuartzJob> selectConfiguration() {
        return mapper.selectConfiguration();
    }

    @Override
    public QuartzJob addConfiguration(QuartzJob job) {
        return mapper.addConfiguration(job);
    }

    @Override
    public QuartzJob removeConfiguration(String jobName) {
        return mapper.removeConfiguration(jobName);
    }

    @Override
    public QuartzJob updateConfiguration(String triggerName, String triggerGroupName, String cron) {
        return mapper.updateConfiguration(triggerName,triggerGroupName,cron);
    }
}
